/*            Copyright(c) 2006-2008 Dave Sexton           *
 * http://www.codeplex.com/DocProject                      *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using DaveSexton.DocProject.Sandcastle.Resources;

namespace DaveSexton.DocProject.Sandcastle.Configuration
{
	[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface")]
	public sealed class ConfigChangeElementCollection : ConfigurationElementCollection
	{
		#region Public Properties
		#endregion

		#region Private / Protected
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="ConfigChangeElementCollection" /> class.
		/// </summary>
		public ConfigChangeElementCollection()
		{
		}
		#endregion

		#region Methods
		protected override ConfigurationElement CreateNewElement()
		{
			return new ConfigChangeElement();
		}

		protected override object GetElementKey(ConfigurationElement element)
		{
			ConfigChangeElement change = element as ConfigChangeElement;

			if (change == null)
				throw new ArgumentException(Errors.ConfigElementNotConfigReplacement);

			return change.Name;
		}
		#endregion
	}
}
